import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { SkVipPriceVO, SkVipPriceForm, SkVipPriceQuery } from '@/api/app/SkVipPrice/types';

/**
 * 查询开通会员价格列表
 * @param query
 * @returns {*}
 */

export const listSkVipPrice = (query?: SkVipPriceQuery): AxiosPromise<SkVipPriceVO[]> => {
  return request({
    url: '/app/SkVipPrice/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询开通会员价格详细
 * @param id
 */
export const getSkVipPrice = (id: string | number): AxiosPromise<SkVipPriceVO> => {
  return request({
    url: '/app/SkVipPrice/' + id,
    method: 'get'
  });
};

/**
 * 新增开通会员价格
 * @param data
 */
export const addSkVipPrice = (data: SkVipPriceForm) => {
  return request({
    url: '/app/SkVipPrice',
    method: 'post',
    data: data
  });
};

/**
 * 修改开通会员价格
 * @param data
 */
export const updateSkVipPrice = (data: SkVipPriceForm) => {
  return request({
    url: '/app/SkVipPrice',
    method: 'put',
    data: data
  });
};

/**
 * 删除开通会员价格
 * @param id
 */
export const delSkVipPrice = (id: string | number | Array<string | number>) => {
  return request({
    url: '/app/SkVipPrice/' + id,
    method: 'delete'
  });
};
